﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Common;
using Common.Views;
using ElectroSystem.Models;

namespace ElectroSystem.Controllers
{
    public class FilterController : MenusController
    {
        //
        // GET: /Filter/

        public ActionResult Index()
        {
            FilterModel fm = new FilterModel(HttpContext.User.Identity.Name);
            return View(fm);
        }

        public PartialViewResult GetFilterTransactions(DateTime startDate, DateTime endDate, int prodID)
        {
            List<OrdersView> filters = new FaultsServ.FaultsServiceClient().FilterTransactions(startDate, endDate, prodID, HttpContext.User.Identity.Name).ToList();
            return PartialView("_prodTrans", filters);
        }
    }
}
